﻿// JavaScript Document


$(function () {

    //{{{搜索
    $("input.submit[name='finds']").click(function () {
        alert('a')
    })

    //{{{编辑
    $("img.edit,input[name=add]").click(function () {
        $(".maincontent").mask()
        var $this = $(this)
        var msg = $this.parent().prev().html()
        //取得姓名内容
        var  name=$this.parent().prev().prev().html() 
        if ($this.attr("name") == "add") {
            msg = ""
            name = ""
        }
        $("#cetd").show()
        //信息
        $('#cetd').dialog({
            title: "Create/Edit"
            , iconCls: "icon-template"
            //, border: true
            , width: 457
            , height: 260
            , buttons: [{
                text: '保存'

                , handler: function () {
                    alert('你点了保存键');
                    $('#cetd').dialog('close');
                }
            }
            , {
                text: '取消'
                , handler: function () {
                    $('#cetd').dialog('close');
                }
            }]
            , onClose: function () {
                $(".maincontent").unmask()
            }
        }).find("input[name='msg']").val(msg);
        //姓名
        $('#cetd').dialog({
            title: "Create/Edit"
            , iconCls: "icon-template"
            //, border: true
            , width: 457
            , height: 260
            , buttons: [{
                text: '保存'

                , handler: function () {
                    alert('你点了保存键');
                    $('#cetd').dialog('close');
                }
            }
            , {
                text: '取消'
                , handler: function () {
                    $('#cetd').dialog('close');
                }
            }]
            , onClose: function () {
                $(".maincontent").unmask()
            }
        }).find("input[name='name']").val(name)
    })
    //}}}

})











